package com.reins.bookstore.dao;

import com.reins.bookstore.entity.Orders;
import com.reins.bookstore.entity.OrderItem;

import java.util.Date;
import java.util.List;

public interface OrderDao {
    Orders findById(Integer id);
    List<Orders> findAll();
    List<Orders> findAll(Date frontDate, Date backDate);

    List<Orders> findAllOrdersByUserId(Integer id);
    List<Orders> findAllOrdersByUserId(Integer id, Date frontDate, Date backDate);
    List<Orders> filterByDate(Date frontDate, Date backDate);
    List<OrderItem> findAllOrderlistsByOrderId(Integer id);
    Orders save(Orders add);
    void deleteOrderById(Integer id);
    //    boolean deleteAllOrderByUserId(Integer userId);
    void deleteOrderItemsByOrderId(Integer orderId);
    Orders saveAndFlush(Orders add);
    void savelist(OrderItem add);
}
